local ZZyimou = fk.CreateSkill {
    name = "ZZyimou",
    anim_type = "control",
}

Fk:loadTranslationTable{
  ["ZZyimou"] = "毅谋",
  [":ZZyimou"] = "回合技，当一名角色受到伤害时，你可以发动一次“幕讨”。",
  ["#QXmutao"] = "毅谋：你可以发动一次“幕讨”",
  ["#QXmutao-invoke"] = "毅谋：你可以发动一次“幕讨”",
}

-- 当角色受到伤害时触发
ZZyimou:addEffect(fk.DamageInflicted,{
  can_trigger = function(self, event, target, player, data)
    return player:hasSkill(ZZyimou.name) and player:usedSkillTimes(ZZyimou.name,Player.HistoryTurn) == 0
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    local success, dat = room:askToUseActiveSkill(player, {
      skill_name = "QXmutao",
      prompt = "#QXmutao",
      cancelable = true,
      no_indicate = false,
    })
    if success and dat then
      room:sortByAction(dat.targets)
      return true
    end
    
  end,
})

return ZZyimou 